package com.wedo.book.service;

import com.wedo.book.mapper.BookHotMapper;
import com.wedo.book.pojo.BookHot;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class BookHotService {

    @Autowired
    private BookHotMapper bookHotMapper;

    /**
     * 根据bid查询图书热度信息
     * @param bid
     * @return
     */
    public BookHot queryBookHotByBid(Long bid) {
        return this.bookHotMapper.selectByPrimaryKey(bid);
    }

    public void updateBookHot(BookHot bookHot) {
        this.bookHotMapper.updateByPrimaryKeySelective(bookHot);
    }
}
